package cn.iocoder.yudao.module.eval.dal.mysql.filingcreation;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.eval.dal.dataobject.filingcreation.FilingCreationDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.eval.controller.admin.filingcreation.vo.*;

/**
 * 创建备案 Mapper
 *
 * @author 龙头企业
 */
@Mapper
public interface FilingCreationMapper extends BaseMapperX<FilingCreationDO> {

    default PageResult<FilingCreationDO> selectPage(FilingCreationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<FilingCreationDO>()
                .likeIfPresent(FilingCreationDO::getEnterpriseName, reqVO.getEnterpriseName())
                .eqIfPresent(FilingCreationDO::getRegisteredAddress, reqVO.getRegisteredAddress())
                .eqIfPresent(FilingCreationDO::getBusinessScope, reqVO.getBusinessScope())
                .eqIfPresent(FilingCreationDO::getUnifiedSocialCreditCode, reqVO.getUnifiedSocialCreditCode())
                .eqIfPresent(FilingCreationDO::getLegalRepresentative, reqVO.getLegalRepresentative())
                .eqIfPresent(FilingCreationDO::getRegistrationAuthority, reqVO.getRegistrationAuthority())
                .eqIfPresent(FilingCreationDO::getInstitutionNature, reqVO.getInstitutionNature())
                .eqIfPresent(FilingCreationDO::getSoeType, reqVO.getSoeType())
                .likeIfPresent(FilingCreationDO::getApplicationName, reqVO.getApplicationName())
                .eqIfPresent(FilingCreationDO::getMohrssFilingNumber, reqVO.getMohrssFilingNumber())
                .likeIfPresent(FilingCreationDO::getHeadOfficeName, reqVO.getHeadOfficeName())
                .eqIfPresent(FilingCreationDO::getLastYearEmployeeCount, reqVO.getLastYearEmployeeCount())
                .eqIfPresent(FilingCreationDO::getLastYearEducationFund, reqVO.getLastYearEducationFund())
                .eqIfPresent(FilingCreationDO::getEmployeeCount, reqVO.getEmployeeCount())
                .eqIfPresent(FilingCreationDO::getRegisteredCapital, reqVO.getRegisteredCapital())
                .eqIfPresent(FilingCreationDO::getLastYearRevenue, reqVO.getLastYearRevenue())
                .eqIfPresent(FilingCreationDO::getEvaluationBusinessLeader, reqVO.getEvaluationBusinessLeader())
                .eqIfPresent(FilingCreationDO::getEvaluationBusinessLeaderPhone, reqVO.getEvaluationBusinessLeaderPhone())
                .eqIfPresent(FilingCreationDO::getEvaluationContact, reqVO.getEvaluationContact())
                .eqIfPresent(FilingCreationDO::getEvaluationContactPhone, reqVO.getEvaluationContactPhone())
                .eqIfPresent(FilingCreationDO::getPublicContact, reqVO.getPublicContact())
                .eqIfPresent(FilingCreationDO::getPublicContactPhone, reqVO.getPublicContactPhone())
                .betweenIfPresent(FilingCreationDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(FilingCreationDO::getId));
    }

}